From the related art, an inkjet printer including a detachable main tank, a sub tank, an image recording unit, and a residual amount detection sensor is known (for example, JP-A-2008-213162). When the main tank is mounted on the inkjet printer, some of the ink stored in the main tank moves to the sub tank. The image recording unit discharges the ink stored in the sub tank. The residual amount detection sensor detects the residual amount of the ink stored in the main tank. The inkjet printer prohibits the image recording unit from discharging the ink when the residual amount detection sensor detects that the residual amount of the ink is less than a threshold.
However, if the residual amount detection sensor malfunctions, the inkjet printer can hardly grasp the residual amount of the ink. In this case, the inkjet printer may continuously discharge the ink through the image recording unit despite the fact that an actual residual amount of the ink is less than the threshold. Then, there are problems that air enters a flow path of the ink extending from the sub tank to the image recording unit (so-called “air-in”) and an image recording quality deteriorates.